    <div class="container-fluid">

      
      <div class="row">

            <form class="form-inline form-left" action="<?php echo site_url()."company";?>">
                    <div class="form-group">
                        <label for="inputEmail3" class="control-label">Search</label>
                        <input type="text" class="form-control" name="search" placeholder="Enter Text">
                        <button type="submit" class="btn btn-primary">Search</button>
                    </div>
            </form>
            <form class="form-inline form-right">
                    <div class="form-group">
                        <button type="submit" class="btn btn-primary">Add Data</button>
                    </div>
            </form>

        
        <table class="table table-bordered table-striped table-hover">
            <tr>
                <th class="m_tabID" data-field="id" valign="bottom" align="center">
                        <form>
                                <button type="submit" class="header-button" value='ID'>#</button>
				<input type="hidden" name="by" value="id">
                                <input type="hidden" name="sort" value="<?php echo $order == 'asc' ? 'desc' : 'asc'; ?>">
                                <br>
                                <?php
                                  if ($by == 'id') {
                                  if ($order=='asc')
                                    {?>
                                    <span class="caret"></span>
                                  <?php    }else if ($order=='desc')
                                    {?>
                                    <span class="caret-up"></span>
                                <?php   }
                                  }
                                ?>
                        </form>
                </th>
                <th class="m_tab1" data-field="m_name" valign="bottom" align="center">
                        <form>
                                <button type="submit" class="header-button" value='Company Name'>Company Name</button>
				<input type="hidden" name="by" value="name">
                                <input type="hidden" name="sort" value="<?php echo $order == 'asc' ? 'desc' : 'asc'; ?>">
                                <br>
                                <?php
                                  if ($by == 'name') {
                                  if ($order=='asc')
                                    {?>
                                    <span class="caret"></span>
                                  <?php    }else if ($order=='desc')
                                    {?>
                                    <span class="caret-up"></span>
                                <?php   }
                                  }
                                ?>
                        </form>                    
                </th>
                <th class="m_tab1" data-field="m_addr" valign="bottom" align="center">
                        <form>
                                <button type="submit" class="header-button" value='Address'>Address</button>
				<input type="hidden" name="by" value="alamat">
                                <input type="hidden" name="sort" value="<?php echo $order == 'asc' ? 'desc' : 'asc'; ?>">
                                <br>
                                <?php
                                  if ($by == 'alamat') {
                                  if ($order=='asc')
                                    {?>
                                    <span class="caret"></span>
                                  <?php    }else if ($order=='desc')
                                    {?>
                                    <span class="caret-up"></span>
                                <?php   }
                                  }
                                ?>
                        </form>                    
                    
                </th>
                <th class="m_tab1" data-field="m_picname" valign="bottom" align="center">
                        <form>
                                <button type="submit" class="header-button" value='PIC'>Person In Charge</button>
				<input type="hidden" name="by" value="nama_pic">
                                <input type="hidden" name="sort" value="<?php echo $order == 'asc' ? 'desc' : 'asc'; ?>">
                                <br>
                                <?php
                                  if ($by == 'nama_pic') {
                                  if ($order=='asc')
                                    {?>
                                    <span class="caret"></span>
                                  <?php    }else if ($order=='desc')
                                    {?>
                                    <span class="caret-up"></span>
                                <?php   }
                                  }
                                ?>
                        </form>   
                </th>
                <th class="m_tab1" data-field="m_pictelp" valign="bottom" align="center">
                        <form>
                                <button type="submit" class="header-button" value='Phone No.'>Phone No.</button>
				<input type="hidden" name="by" value="telp_pic">
                                <input type="hidden" name="sort" value="<?php echo $order == 'asc' ? 'desc' : 'asc'; ?>">
                                <br>
                                <?php
                                  if ($by == 'telp_pic') {
                                  if ($order=='asc')
                                    {?>
                                    <span class="caret"></span>
                                  <?php    }else if ($order=='desc')
                                    {?>
                                    <span class="caret-up"></span>
                                <?php   }
                                  }
                                ?>
                        </form> 
                </th>
                <th class="m_tab1" data-field="m_picture" valign="bottom" align="center">
                        <form>
                                <button type="submit" class="header-button" value='Picture'>Picture</button>
				<input type="hidden" name="by" value="img">
                                <input type="hidden" name="sort" value="<?php echo $order == 'asc' ? 'desc' : 'asc'; ?>">
                                <br>
                                <?php
                                  if ($by == 'img') {
                                  if ($order=='asc')
                                    {?>
                                    <span class="caret"></span>
                                  <?php    }else if ($order=='desc')
                                    {?>
                                    <span class="caret-up"></span>
                                <?php   }
                                  }
                                ?>
                        </form>
                </th>
                <th class="m_tab1" data-field="m_type" valign="bottom" align="center">
                        <form>
                                <button type="submit" class="header-button" value='Type'>Type</button>
				<input type="hidden" name="by" value="type">
                                <input type="hidden" name="sort" value="<?php echo $order == 'asc' ? 'desc' : 'asc'; ?>">
                                <br>
                                <?php
                                  if ($by == 'type') {
                                  if ($order=='asc')
                                    {?>
                                    <span class="caret"></span>
                                  <?php    }else if ($order=='desc')
                                    {?>
                                    <span class="caret-up"></span>
                                <?php   }
                                  }
                                ?>
                        </form>
                </th>
            </tr>
            <?php 
            foreach ($results as $row)
            {?>
                <tr>
                    <td class="linkid"><a class="decorId" href="#"><?php echo $row->id; ?></a></td>
                    <td><?php echo $row->name; ?></td>
                    <td><?php echo $row->alamat; ?></td>
                    <td><?php echo $row->nama_pic; ?></td>
                    <td><?php echo $row->telp_pic; ?></td>
                    <td><?php echo $row->img; ?></td>
                    <td><?php if ($row->type == 0){ echo 'Merchant';}else if ($row->type == 1){echo 'Issuer';}else if ($row->type == 2){echo 'Both';} ?></td>
                </tr>
            <?php 
            }            
            ?>
        </table>
          
        <div class="paging_location"> 
            
            <ul class="pagination">
            <?php 
                $data = array('by'=>$by,'sort'=>$order);
                $myuri = http_build_query($data);
                for ($x = 1; $x <= $links; $x++)
                {?>
                <li <?php echo $x == $cur_page ? "class=active" : "" ?>><a href="<?php echo site_url()."company?page=".$x."&".$myuri;?>"><?php echo $x;?></a></li>
                <?php }
            ?>
            </ul>
        </div>
      </div>
      
        
    </div>
      
      
      
  </body>
</html>